package com.example.ymm.modules1.service.user;

import com.example.ymm.base.BaseService;
import com.example.ymm.model.TableList;
import com.example.ymm.model.YmPageDto;
import com.example.ymm.modules1.entity.my.user.DbOrder;
import com.example.ymm.modules1.entity.my.user.DbOrderItem;
import com.example.ymm.modules1.query.DbOrderQueryCriteria;
import com.example.ymm.modules1.service.dto.SysRankingQueryCriteria;

import java.math.BigDecimal;
import java.util.List;

public interface DbOrderService extends BaseService<DbOrder> {


    TableList<DbOrder> list(DbOrderQueryCriteria criteria, YmPageDto ymPage);

    List<DbOrder> queryAll(DbOrderQueryCriteria criteria);

    /**
     * 立刻购买
     * @param dbOrderItem
     * @return
     */
    DbOrder buyNow(DbOrderItem dbOrderItem);

    DbOrder orderCancel(String orderId);


    List<DbOrder> getOneHourOrderList(DbOrderQueryCriteria criteria);


    /**
     * 用户取消订单
     * @param orderId
     * @return
     */
    DbOrder userOrderCancel(String orderId);

    DbOrder takesOrder(String orderId);

    DbOrder detail(String orderId);

    /**
     * 超过一小时订单状态修改成 准备中2
     */
    void syncLockOrders();


    Integer orderNumCount(SysRankingQueryCriteria criteria);


    /**
     * 统计系统中 已兑换积分
     */
    Double totalConversionIntegral(SysRankingQueryCriteria criteria);

}
